# 方法一
# try:
#     num= int(input("请输入一个数:"))
#     result = 1/num
#     print(result)
# except Exception as a:
#     print(a)


# 方法二
try:
    num= int(input("请输入一个数:"))
    result = 1/num
    print(result)
except :
    print("代码异常")